/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.core.model.utils;

import org.grayrabbit.pay.core.model.entity.transaction.Trade;
import org.grayrabbit.pay.core.model.entity.transaction.TradeRecord;

/**
 * 订单操作工具类
 * 
 * @author wy
 * @version $Id: TradeUtil.java, v 0.1 2012-6-7 下午4:06:06 wy Exp $
 */
public class TradeUtil {
    
    /**
     * 根据交易生成对应的历史变更记录
     * 
     * @param trade
     * @return
     */
    public static TradeRecord fromTrade(Trade trade){
        TradeRecord tradeRecord = new TradeRecord();
        tradeRecord.setAppSystemCode(trade.getAppSystemCode());
        tradeRecord.setGmtOperate(trade.getGmtOperate());
        tradeRecord.setMemo(trade.getMemo());
        tradeRecord.setOperater(trade.getOperater());
        tradeRecord.setOrderStatus(trade.getTradeStatus());
        tradeRecord.setTradeId(trade.getTradeId());
        return tradeRecord;
    }

}
